define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Livechat1, $stateParams, $sce, GoPage, GoDialog) {
		
		$scope.order_id = $stateParams.order_id;
		$scope.store_id = $stateParams.store_id; 
		$scope.member_id = $stateParams.member_id; 
		
		//页面离开，分享关闭
		$scope.$on('$ionicView.afterEnter', function() {
			$scope.loadIframe();
			//动态设置高度
			GoPage.init_top($scope, 0, 0);
		}, false);
		$scope.loadIframe = function() {
			var url = HTTP_CHAT1_URL + "?order_id=" + $scope.order_id + "&store_id=" + $scope.store_id + "&member_id=" + $scope.member_id;
			$scope.myURL = $sce.trustAsResourceUrl(url);
		};
	}

	controller.$inject = ['$scope', 'Livechat1', '$stateParams', '$sce', 'GoPage', 'GoDialog'];

	return app.registerController("livechat1ctrl", controller);
});